Generates a rectangle from two points entered through mouse clicks. Depending on the current element generation mode, the rectangle may be used for the generation of a polyline or an area.